package bean

import "reflect"

func GetBeanName(b Bean) string {
	var beanName string
	if beanName = b.Bean(); beanName == "" {
		beanName = reflect.TypeOf(b).Elem().String()
	}
	return beanName
}

func GetName(b interface{}) string {
	if bean, ok := b.(Bean); ok {
		return GetBeanName(bean)
	}
	return reflect.TypeOf(b).Elem().String()
}
